# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-billiard
pkgver=3.6.4.0
pkgrel=5
pkgdesc="Python multiprocessing fork with improvements and bugfixes"
url="https://pypi.org/project/billiard/"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-setuptools py3-wheel py3-gpep517"
checkdepends="py3-psutil py3-pytest py3-nose py3-case"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/b/billiard/billiard-$pkgver.tar.gz
	$pkgname-py311.patch::https://github.com/celery/billiard/commit/ff8efc5d689ef048f5203593390f1ff6a052a5d5.patch
	"
builddir="$srcdir/billiard-$pkgver"

replaces="py-billiard" # Backwards compatibility
provides="py-billiard=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# Uses wrong name for 'queue' module.
	# Uses internal 'test' and 'test.support' modules.
	rm -f t/integration/tests/test_multiprocessing.py

	# Windows only
	rm -f t/unit/test_win32.py

	py.test-3
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
9f2a44024e45c4e7667472a0a3ade7caae755ec7c163929433f818e4b87165218b9cc9545bdee2254e7159c206e525306e383d38906b00fd5428bd1616c39b8f  billiard-3.6.4.0.tar.gz
589f57ce516cec2740cff6f06f396caac856b75ff4c7dc022c6b1b60f0d97f590667ff3c0ee4887926556c073241d89a4734658d35dcfb41fc71117fdc2c8426  py3-billiard-py311.patch
"
